package com.jbm;

import com.rsa.cmbVerifyTools;
import net.sf.json.JSONObject;

import java.io.IOException;
import java.net.InetAddress;

/**
 * Created by root on 18-8-1.
 */
public class BSign
{
	public static void main(String[] args) throws IOException
	{
		InetAddress appjbm = InetAddress.getByName("app.jiabangmang.com");
		System.out.println(appjbm.getHostAddress());

		JSONObject jObj = JSONObject.fromObject("{\"id\":\"120106196010170571\",\"method\":\"open\",\"mobile\":\"\",\"door\":\"192.168.19.163\"}");
//		JSONObject jObj = JSONObject.fromObject("{\"id\":\"120103197011206148\",\"method\":\"get_door_list\",\"mobile\":\"\",\"door1\":\"444444\"}");
		System.out.println("??:" + jObj);

		String sign = cmbVerifyTools.cmbSign("private.key", jObj);
//		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		/*
		jObj.put("id","120105197810302147");
		jObj.put("door","192.168.19.128");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120105197810302147");
		jObj.put("door","192.168.19.130");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","12010419570716211X");
		jObj.put("door","192.168.19.131");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","12010419570716211X");
		jObj.put("door","192.168.19.132");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","12010419570716211X");
		jObj.put("door","192.168.19.133");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120105196301233935");
		jObj.put("door","192.168.19.113");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120105196301233935");
		jObj.put("door","192.168.19.114");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120105196301233935");
		jObj.put("door","192.168.19.115");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120104195908223839");
		jObj.put("door","192.168.19.116");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120104195908223839");
		jObj.put("door","192.168.19.117");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120104195908223839");
		jObj.put("door","192.168.19.118");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120103198806134517");
		jObj.put("door","192.168.19.104");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120103198806134517");
		jObj.put("door","192.168.19.105");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120103198806134517");
		jObj.put("door","192.168.19.106");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120103198806134517");
		jObj.put("door","192.168.19.163");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120103198806134517");
		jObj.put("door","192.168.19.164");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120103198806134517");
		jObj.put("door","192.168.19.165");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120103198806134517");
		jObj.put("door","192.168.19.166");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120103198806134517");
		jObj.put("door","192.168.19.167");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120105198203033381");
		jObj.put("door","192.168.19.119");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120105198203033381");
		jObj.put("door","192.168.19.154");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj.put("id","120105198203033381");
		jObj.put("door","192.168.19.121");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");

		jObj = JSONObject.fromObject("{\"id\":\"120104195908223839\",\"method\":\"share\",\"mobile\":\"15800010019\",\"door\":\"192.168.19.163\"}");
		sign = cmbVerifyTools.cmbSign("private.key", jObj);
		System.out.println("{\"data\":"+jObj+",\"sign\":\"" + sign +"\"}");
		*/
	}
}
